﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RMS.Utils.MVP;
using RMS.Web.Shell.View;
using RMS.DataAccess.Entities;
using RMS.DataAccess.Repositories;
using RMS.DataAccess.Common;
using RMS.Utils.Authentication;

namespace RMS.Web.Shell.Presenter
{
    public class GetRequestReportPresenter : Presenter<IGetRequestReportView>
    {
        DoctorRequestsDtoRepository _doctorRequestsDtoRepository;
        IAuthentication _authentication;
        public GetRequestReportPresenter(DoctorRequestsDtoRepository doctorRequestsDtoRepository, IAuthentication authentication)
        {
            _doctorRequestsDtoRepository = doctorRequestsDtoRepository;
            _authentication = authentication;
        }

        public EntityResult<DoctorRequestsDto> GetRequests(int startIndex, int lenght)
        {
            return _doctorRequestsDtoRepository.Find(item =>
            {
                item.Employee_id = _authentication.CurrentLogedInMember.Id;
                item.RequestStatues = true;
            }, DoctorRequestsDtoColumns.RequestDate, startIndex, lenght);
        }

    }
}
